how to implement pinters as function